package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IProductCheckLogDao;
import com.financing.platform.dto.ProductCheckLogDTO;
import com.financing.platform.service.IProductCheckLogService;
/**
 * product_check_log  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("productCheckLogService")
public class ProductCheckLogServiceImpl implements IProductCheckLogService{

	@Autowired
	private IProductCheckLogDao productCheckLogDao;

	@Override
	public int insert(ProductCheckLogDTO productCheckLog) throws SQLException {
		return productCheckLogDao.insert(productCheckLog);
	}

	@Override
	public void update(ProductCheckLogDTO productCheckLog) throws SQLException {
		productCheckLogDao.update(productCheckLog);
	}

	@Override
	public void updateForce(ProductCheckLogDTO productCheckLog) throws SQLException {
		productCheckLogDao.updateForce(productCheckLog);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		productCheckLogDao.delete(id);
	}
	
	@Override
	public List<ProductCheckLogDTO> queryList(ProductCheckLogDTO productCheckLog) throws SQLException {
		return productCheckLogDao.queryList(productCheckLog);
	}

	@Override
	public int queryListCount(ProductCheckLogDTO productCheckLog) throws SQLException {
		return productCheckLogDao.queryListCount(productCheckLog);
	}

	@Override
	public ProductCheckLogDTO loadById(Integer id) throws SQLException {
		return productCheckLogDao.loadById(id);
	}
 	@Override
	public ProductCheckLogDTO queryListGetFirst(ProductCheckLogDTO productCheckLog)
			throws SQLException {
		 List<ProductCheckLogDTO> queryList = queryList(productCheckLog);
		 if(queryList==null||queryList.size()==0){
			 return new ProductCheckLogDTO();
		 }
		 return queryList.get(0);
	}
}
